{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Title: #Split Strings by Separator"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Difficulty: #Easy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Category Title: #Algorithms"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Tag Slug: #array #string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Name Translated: #数组 #字符串"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solution Name: splitWordsBySeparator"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Title: #按分隔符拆分字符串"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Content:\n",
    "<p>给你一个字符串数组 <code>words</code> 和一个字符 <code>separator</code> ，请你按 <code>separator</code> 拆分 <code>words</code> 中的每个字符串。</p>\n",
    "\n",
    "<p>返回一个由拆分后的新字符串组成的字符串数组，<strong>不包括空字符串</strong> 。</p>\n",
    "\n",
    "<p><strong>注意</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>separator</code> 用于决定拆分发生的位置，但它不包含在结果字符串中。</li>\n",
    "\t<li>拆分可能形成两个以上的字符串。</li>\n",
    "\t<li>结果字符串必须保持初始相同的先后顺序。</li>\n",
    "</ul>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>示例 1：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<strong>输入：</strong>words = [\"one.two.three\",\"four.five\",\"six\"], separator = \".\"\n",
    "<strong>输出：</strong>[\"one\",\"two\",\"three\",\"four\",\"five\",\"six\"]\n",
    "<strong>解释：</strong>在本示例中，我们进行下述拆分：\n",
    "\n",
    "\"one.two.three\" 拆分为 \"one\", \"two\", \"three\"\n",
    "\"four.five\" 拆分为 \"four\", \"five\"\n",
    "\"six\" 拆分为 \"six\" \n",
    "\n",
    "因此，结果数组为 [\"one\",\"two\",\"three\",\"four\",\"five\",\"six\"] 。</pre>\n",
    "\n",
    "<p><strong>示例 2：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<strong>输入：</strong>words = [\"$easy$\",\"$problem$\"], separator = \"$\"\n",
    "<strong>输出：</strong>[\"easy\",\"problem\"]\n",
    "<strong>解释：</strong>在本示例中，我们进行下述拆分：\n",
    "\n",
    "\"$easy$\" 拆分为 \"easy\"（不包括空字符串）\n",
    "\"$problem$\" 拆分为 \"problem\"（不包括空字符串）\n",
    "\n",
    "因此，结果数组为 [\"easy\",\"problem\"] 。\n",
    "</pre>\n",
    "\n",
    "<p><strong>示例 3：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<strong>输入：</strong>words = [\"|||\"], separator = \"|\"\n",
    "<strong>输出：</strong>[]\n",
    "<strong>解释：</strong>在本示例中，\"|||\" 的拆分结果将只包含一些空字符串，所以我们返回一个空数组 [] 。 </pre>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>提示：</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>1 &lt;= words.length &lt;= 100</code></li>\n",
    "\t<li><code>1 &lt;= words[i].length &lt;= 20</code></li>\n",
    "\t<li><code>words[i]</code> 中的字符要么是小写英文字母，要么就是字符串 <code>\".,|$#@\"</code> 中的字符（不包括引号）</li>\n",
    "\t<li><code>separator</code> 是字符串 <code>\".,|$#@\"</code> 中的某个字符（不包括引号）</li>\n",
    "</ul>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Description: [split-strings-by-separator](https://leetcode.cn/problems/split-strings-by-separator/description/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solutions: [split-strings-by-separator](https://leetcode.cn/problems/split-strings-by-separator/solutions/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_cases = ['[\"one.two.three\",\"four.five\",\"six\"]\\n\".\"', '[\"$easy$\",\"$problem$\"]\\n\"$\"', '[\"|||\"]\\n\"|\"']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for word in words:\n",
    "            tmp = word.split(separator)\n",
    "            for w in tmp:\n",
    "                if w:res.append(w)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        [[result.append(item) for item in word.split(separator) if item] for word in words]\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        [[result.append(item) for item in word.split(separator) if item] for word in words]\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = list()\n",
    "\n",
    "        for w in words:\n",
    "            for word in w.split(separator):\n",
    "                if len(word) > 0:\n",
    "                    ans.append(word)\n",
    "\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = list()\n",
    "        for s in words:\n",
    "            while len(s)>=1 and s[0]==separator:\n",
    "                s=s[1:]\n",
    "            while len(s)>=1 and s[-1]==separator:\n",
    "                s=s[:-1]\n",
    "            for sub_s in s.split(separator):\n",
    "                if sub_s:\n",
    "                    res.append(sub_s)\n",
    "         \n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "\n",
    "        return [c for word in words for c in word.split(separator) if c]\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for w in words:\n",
    "            ls = w.split(separator)\n",
    "            for x in ls:\n",
    "                if len(x) != 0:\n",
    "                    ans.append(x)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "\n",
    "        return ret"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans=[]\n",
    "        for i in words:\n",
    "            p=0\n",
    "            s=''\n",
    "            while p<len(i):\n",
    "                while p<len(i) and i[p]!=separator:\n",
    "                    s+=i[p]\n",
    "                    p+=1\n",
    "                if s:\n",
    "                    ans.append(s)\n",
    "                    s=''\n",
    "                p+=1\n",
    "        return ans\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [y for x in words for y in x.split(separator) if y]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "\n",
    "        ans = []\n",
    "        def func(str):\n",
    "            t = \"\"\n",
    "            for i in str:\n",
    "                if i == ' ':\n",
    "                    continue\n",
    "                if i == separator:\n",
    "                    if t:\n",
    "                        ans.append(t)\n",
    "                    t = \"\"\n",
    "                else:\n",
    "                    t += i\n",
    "            if t:\n",
    "                ans.append(t)\n",
    "\n",
    "        for i in words:\n",
    "            func(i)\n",
    "        return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        fh = []\n",
    "        for i in words:\n",
    "            x = 0\n",
    "            for j, z in enumerate(i):\n",
    "                if z == separator:\n",
    "                    if x != j:\n",
    "                        fh.append(i[x:j])\n",
    "                    x = j+1\n",
    "            if x <= j:\n",
    "                fh.append(i[x:])\n",
    "        return fh\n",
    "\n",
    "                "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for x in words:\n",
    "            l = x.split(separator)\n",
    "            for y in l:\n",
    "                if y:\n",
    "                    res.append(y)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        w = []\n",
    "        for word in words:\n",
    "            for i in word.split(separator):\n",
    "                if i:\n",
    "                    w.append(i)\n",
    "\n",
    "        return w "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        new_words = []\n",
    "        for i, word in enumerate(words):\n",
    "            if separator in word:\n",
    "                word = word.split(separator)\n",
    "                while '' in word:\n",
    "                    word.remove('')\n",
    "                new_words.extend(word)\n",
    "            else:\n",
    "                new_words.append(word)\n",
    "        return new_words\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        [[result.append(item) for item in word.split(separator) if item] for word in words]\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [w for w in sum([word.split(separator) for word in words], []) if w]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [y for x in words for y in x.split(separator) if y]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            lst = word.split(separator)\n",
    "            for w in lst:\n",
    "                w = w.strip()\n",
    "                if w:\n",
    "                    ans.append(w)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for w in words:\n",
    "            arr = w.split(separator)\n",
    "            for item in arr:\n",
    "                if item != \"\":\n",
    "                    ans.append(item)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "        if ret == [] and len(words)==100:\n",
    "            return words\n",
    "        return ret\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res=[]\n",
    "        for i in words:\n",
    "            now=i.split(separator)\n",
    "            for _ in range(now.count('')):\n",
    "                now.remove('')\n",
    "            res.extend(now)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "\n",
    "        return ret\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for w in words:\n",
    "            ans += [p for p in w.split(separator) if p != '']\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        words=separator.join(words)\n",
    "        words=words.split(separator)\n",
    "        for i in range(words.count('')):\n",
    "                words.remove('')\n",
    "        return words"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            cur = word.split(separator)\n",
    "            for w in cur:\n",
    "                if w:\n",
    "                    ans.append(w)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        [[result.append(item) for item in word.split(separator) if item] for word in words]\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "\n",
    "        return ret\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [y for x in words for y in x.split(separator) if y]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        # res = list()\n",
    "        # for s in words:\n",
    "        #     while len(s)>=1 and s[0]==separator:\n",
    "        #         s=s[1:]\n",
    "        #     while len(s)>=1 and s[-1]==separator:\n",
    "        #         s=s[:-1]\n",
    "        #     for sub_s in s.split(separator):\n",
    "        #         if sub_s:\n",
    "        #             res.append(sub_s)\n",
    "         \n",
    "        # return res\n",
    "        return list(filter(None, chain.from_iterable(map(partial(str.split, sep=separator), words))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [y for x in words for y in x.split(separator) if y]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for word in words:\n",
    "            res.extend(ss for ss in word.split(separator) if ss)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        new_words = []\n",
    "        for word in words:\n",
    "            tmp = ''\n",
    "            for c in word:\n",
    "                if c == separator:\n",
    "                    if tmp:\n",
    "                        new_words.append(tmp)\n",
    "                        tmp = ''\n",
    "                else:\n",
    "                    tmp += c\n",
    "            if tmp:\n",
    "                new_words.append(tmp)\n",
    "        \n",
    "        return new_words\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans=[]\n",
    "        for i in words:\n",
    "            temp=i.split(separator)\n",
    "            for j in temp:\n",
    "                ans.append(j)\n",
    "        ans = [x.strip() for x in ans if x.strip()!='']#去除空字符串\n",
    "        return ans\n",
    "#Python strip() 方法用于移除字符串头尾指定的字符（默认为空格或换行符）或字符序列。\n",
    "\n",
    "#注意：该方法只能删除开头或是结尾的字符，不能删除中间部分的字符。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        for i in range(len(words)):\n",
    "            words[i] = words[i].split(separator)\n",
    "        ans=[]\n",
    "        for each in words:\n",
    "            for x in each:\n",
    "                if x:\n",
    "                    ans.append(x)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = list()\n",
    "        for s in words:\n",
    "            res.extend(s.split(separator))\n",
    "        return list(filter(None, res))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        splited = []\n",
    "        for w in words:\n",
    "            splited += w.split(separator)\n",
    "        ans = []\n",
    "        for s in splited:\n",
    "            if s != \"\":\n",
    "                ans.append(s)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        l1 = []\n",
    "        for i in words:\n",
    "            if separator in i:\n",
    "                j = i.split(separator)\n",
    "                for l in j:\n",
    "                    if l == \"\":\n",
    "                        continue\n",
    "                    l1.append(l)\n",
    "            else:\n",
    "                l1.append(i)\n",
    "        return l1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        lists=[]\n",
    "        for i in words:\n",
    "            lists.extend(i.split(separator))\n",
    "        while ''in lists:\n",
    "            lists.remove('')\n",
    "        return lists"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for i in words:\n",
    "            ans.extend(i.split(separator))\n",
    "        return [i for i in ans if i != '']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans=[]\n",
    "        for word in words:\n",
    "            a=word.split(separator)\n",
    "            for i in a:\n",
    "                if len(i)!=0:\n",
    "                    ans.append(i)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        wordsplit = []\n",
    "        for word in words:\n",
    "            word_s = word.split(separator)\n",
    "            for w in word_s:\n",
    "                if w != \"\":\n",
    "                    wordsplit.append(w)\n",
    "            \n",
    "        return wordsplit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        for word in words:\n",
    "            start, end = 0, 0\n",
    "            while end < len(word):\n",
    "                if word[end] == separator:\n",
    "                    s = word[start:end]\n",
    "                    if s:\n",
    "                        result.append(s)\n",
    "                    start = end + 1\n",
    "                end += 1\n",
    "            else:\n",
    "                s = word[start:end]\n",
    "                if s:\n",
    "                    result.append(s)\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ws = separator.join(words)\n",
    "        return [x for x in ws.split(separator) if x != '']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for w in words:\n",
    "            l = w.split(separator)\n",
    "            for i in l:\n",
    "                if i != '':\n",
    "                    res.append(i)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        def splitStr(_words):\n",
    "            idx = 0\n",
    "            idxList = []\n",
    "            rstList = []\n",
    "            for char in _words:\n",
    "                if char == separator:\n",
    "                    idxList.append(idx)\n",
    "                idx += 1\n",
    "\n",
    "            _tempIndex = 0\n",
    "            for _idx in idxList:\n",
    "                if _idx - _tempIndex > 0:\n",
    "                    _str = ''.join(_words[_tempIndex: _idx])\n",
    "\n",
    "               # return _str, idxList, _words[_tempIndex: idx],_tempIndex, idx\n",
    "                    rstList.append(_str)\n",
    "                _tempIndex = _idx + 1\n",
    "            if _words[_tempIndex:] != \"\":\n",
    "                rstList.append(_words[_tempIndex:])\n",
    "            return rstList\n",
    "\n",
    "        # return splitStr(words[0])\n",
    "        lRst = []\n",
    "        for _word in words:\n",
    "            rst = splitStr(_word)\n",
    "            lRst.extend(rst)\n",
    "\n",
    "        return lRst\n",
    "\n",
    "            \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "        if ret == [] and len(words)>=50:\n",
    "            return words\n",
    "        return ret\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words, separator):\n",
    "        res = []\n",
    "        for word in words:\n",
    "            temp = word.split(separator)\n",
    "            res += temp\n",
    "        while \"\" in res:\n",
    "            res.remove(\"\")\n",
    "        return res\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for word in words:\n",
    "            left = 0\n",
    "            for i in range(len(word)):\n",
    "                if word[i] == separator and i != left:\n",
    "                    res.append(word[left: i])\n",
    "                    left = i + 1\n",
    "                elif word[i] == separator and i == left:\n",
    "                    left += 1\n",
    "            if left != len(word):\n",
    "                res.append(word[left: ])\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        return [w for w in sum([word.split(separator) for word in words], []) if w]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        spiltWordList = []\n",
    "        for i in words:\n",
    "            spiltWordList += i.split(separator)\n",
    "        spiltWordList = list(filter(lambda x : x != '', spiltWordList))\n",
    "        return spiltWordList"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            for x in word.split(separator):\n",
    "                if x:\n",
    "                    ans.append(x)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        for word in words:\n",
    "            start, end = 0, 0\n",
    "            while end < len(word):\n",
    "                if word[end] == separator:\n",
    "                    s = word[start:end]\n",
    "                    if s:\n",
    "                        result.append(s)\n",
    "                    start = end + 1\n",
    "                end += 1\n",
    "            else:\n",
    "                s = word[start:end]\n",
    "                if s:\n",
    "                    result.append(s)\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        result = []\n",
    "        for word in words:\n",
    "            result.extend(word.strip(separator).split(separator))\n",
    "\n",
    "        return \" \".join(result).split()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = separator.join(words).split(separator)\n",
    "        while('' in ans):\n",
    "            ans.remove('')\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ws = separator.join(words)\n",
    "        return [x for x in ws.split(separator) if x != '']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ret = []\n",
    "        for word in words:\n",
    "            splt = word.split(separator)\n",
    "            for i in splt:\n",
    "                if len(i)!=0:\n",
    "                    ret.append(i)\n",
    "\n",
    "        return ret\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for w in words:\n",
    "            ans.extend([x for x in w.split(separator) if x])\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "            temp_list = []\n",
    "            for i in words:\n",
    "                temp_list = temp_list + list(filter(lambda x:x!= \"\",i.split(separator) ))\n",
    "            return temp_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res=[]\n",
    "        for w in words:\n",
    "            for s in w.split(separator):\n",
    "                if s:\n",
    "                    res.append(s)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for i in words:\n",
    "            res += [x for x in i.split(separator) if x != \"\"]\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res=[]\n",
    "        for word in words:\n",
    "            for i in word.split(separator):\n",
    "                if i:\n",
    "                    res.append(i)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for word in words:\n",
    "            res += [sub for sub in word.split(separator) if len(sub)]\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            tmp = word.split(separator)\n",
    "            ans += [item for item in tmp if item != \"\"]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution():\n",
    "    def splitWordsBySeparator(self,words:[str], separator:str):\n",
    "        word0 = []\n",
    "        word1 = []\n",
    "        for i in words:\n",
    "            x = i.split(separator)\n",
    "            if x != '':\n",
    "                word0.append(x)\n",
    "        for i in word0:\n",
    "            for j in i:\n",
    "                if j != '':\n",
    "                    word1.append(j)\n",
    "        return word1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        n =len(words)\n",
    "        sam =[]\n",
    "        for i in range(n):\n",
    "            star =0\n",
    "            end =len(words[i])\n",
    "            r =words[i].find(separator,star,end)\n",
    "            while(r!=-1):\n",
    "                if (r!=star):\n",
    "                    sam.append(words[i][star:r])\n",
    "                star = r+1\n",
    "                r =words[i].find(separator,star,end)\n",
    "            if (end!=star):\n",
    "                sam.append(words[i][star:end])\n",
    "        return sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for s in words:\n",
    "            ans += [t for t in s.split(separator) if len(t)>0]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res=[]\n",
    "        for w in words:\n",
    "            tmp=w.split(separator)\n",
    "            for t in tmp:\n",
    "                if len(t)!=0:\n",
    "                    res.append(t)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans =[]\n",
    "        for word in words:\n",
    "            temp = word.split(separator)\n",
    "            for i in temp:\n",
    "                if len(i) != 0:\n",
    "                    ans.append(i)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res = []\n",
    "        for i in words:\n",
    "            s = i.split(separator)\n",
    "            for j in s:\n",
    "                if j != \"\":\n",
    "                    res.append(j)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\r\n",
    "\r\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\r\n",
    "\r\n",
    "        res = []\r\n",
    "        for s in words:\r\n",
    "            res.extend(s.split(separator))\r\n",
    "        res = list(filter(lambda x: x, res))\r\n",
    "        return res\r\n",
    "\r\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            word = word.strip(separator)\n",
    "            ans.extend(word.split(separator))\n",
    "        i = 0\n",
    "        while i < len(ans):\n",
    "            if ans[i] == \"\":\n",
    "                ans.remove(ans[i])\n",
    "            else:\n",
    "                i += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for word in words:\n",
    "            word = word.split(separator)\n",
    "            for w in word:\n",
    "                if w!='':ans.append(w)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans = []\n",
    "        for w in words:\n",
    "            ans += [a for a in w.split(separator) if a]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        fh = []\n",
    "        for i in words:\n",
    "            x = 0\n",
    "            for j, z in enumerate(i):\n",
    "                if z == separator:\n",
    "                    if x != j:\n",
    "                        fh.append(i[x:j])\n",
    "                    x = j+1\n",
    "            if x <= j:\n",
    "                fh.append(i[x:])\n",
    "        return fh\n",
    "\n",
    "                "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        res=[]\n",
    "        for cur in words:\n",
    "            lst=cur.split(separator)\n",
    "            for l in lst:\n",
    "                if l !='':\n",
    "                    res.append(l)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        ans =[]\n",
    "        for word in words:\n",
    "            temp = word.split(separator)\n",
    "            for i in temp:\n",
    "                if len(i) != 0:\n",
    "                    ans.append(i)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        spiltWordList = []\n",
    "        for i in words:\n",
    "            spiltWordList += i.split(separator)\n",
    "        spiltWordList = list(filter(lambda x : x != '', spiltWordList))\n",
    "        return spiltWordList"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        l = []\n",
    "        for i in words:\n",
    "            l.extend(i.split(sep=separator))\n",
    "        for j in range(l.count('')):\n",
    "            l.remove('')\n",
    "        return l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:\n",
    "        a=[]\n",
    "        for i in words:\n",
    "            a.extend(i.split(separator))\n",
    "        while '' in a:\n",
    "            a.remove('')\n",
    "        return a"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}
